package com.example.socket;



/**
 * @Classname Servlet
 * @Description TODO
 * @Date 2023/4/27 11:09
 * @Created by XiongXiong
 * @Author: X.I.O
 */
public abstract class Servlet {

    public abstract void doGet(ServletRequest request, ServletResponse response) ;


    public abstract void doPost(ServletRequest request, ServletResponse response) ;


    public void service(ServletRequest request,ServletResponse response){
        if(request.getMethod().equalsIgnoreCase("POST")){
            doPost(request,response);
        }else if (request.getMethod().equalsIgnoreCase("GET")){
            doGet(request, response);
        }
        //最后输出结果
    }
}
